import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 姚东名
 * Date: 2024-07-02
 * Time: 11:55
 */
public class Test {
    public static void main(String[] args) {
        Student student1 = new Student("张三", 10);
        Student student2 = new Student("李四", 20);
        Student student3 = new Student("王五", 30);

        ArrayList<Student> students = new ArrayList<>();
        students.add(0, student1);
        students.add(1, student2);
        students.add(2, student3);

        System.out.println(students);
    }
}

//[Student{'name=张三' age=10}, Student{'name=李四' age=20}, Student{'name=王五' age=30}]